package com.mrx.xfriendship.dao;

import com.mrx.xfriendship.model.po.UserPO;
import com.mrx.xfriendship.model.vo.UserManagerPageVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author Mr.X
 * @since 2023-01-14 10:50:30
 */
@Mapper
public interface UserMapper {

    int deleteByPrimaryKey(Integer id);

    int insert(UserPO record);

    /**
     * 插入一条 用户记录, 只会处理 name 和 pass
     */
    int insertSelective(UserPO record);

    UserPO selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(UserPO record);

    int updateByPrimaryKey(UserPO record);

    UserPO selectByName(String name);

    List<UserPO> listUsers(UserManagerPageVO vo);

    List<UserPO> selectByIds(@Param("ids") List<Integer> ids);

    int bindMail(@Param("name") String name, @Param("mail") String mail);

    UserPO selectByEmail(String mail);

}
